package file;

public class ArrayDemo3 {
    public static  void main(String[] args) {
        //二维数组：每行存储[编号，名称，借阅次数]
        String[][] books = {
                {"B001","Java编程基础","10"},
                {"B002","数据结构与算法","15"},
                {"B003","数据库原理","20"},
        };

        //输出表头
        System.out.println("图书编号\t书名\t\t借阅次数");
        System.out.println("-----------------------------");

        //遍历二维数组
        for (int i = 0; i < books.length; i++) {
            //遍历每行的元素
            for (int j = 0; j < books[i].length; j++) {
                System.out.println(books[i][j] + "\t");
            }
            System.out.println(); //执行
        }
    }
}
